package com.katze.boot.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.katze.boot.common.domain.ActiveUser;
import com.katze.boot.system.domain.DeptUsers;
import com.katze.boot.system.domain.User;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface UserMapper extends BaseMapper<User> {

    IPage<User> findUserDetail(Page<User> page, @Param("user") User user);

    /**
     * 获取单个用户详情
     *
     * @param username 用户名
     * @return 用户信息
     */
    User findDetail(@Param("username")String username, @Param("password")String password);

    List<ActiveUser> findActiveUserByUsernames(@Param("usernames") Collection<String> usernames);

    String findSubordinates(@Param("deptId") Long deptId);

    List<DeptUsers> findSubordinatesMap();

    Integer deleteUserByUsername(@Param("username") String username);
}
